home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 January / PCWorld_2007-01_cd.bin / v cisle / autoit / autoit-v3.2.0.1-setup.exe / Examples / Helpfile / _GUICtrlTreeViewItemGetTree.au3 < prev    next >
Text File  |  2006-06-17  |  1KB  |  45 lines

  1. #include <GUIConstants.au3>
  2. #include <GuiTreeView.au3>
  3.  
  4. opt("MustDeclareVars", 1)
  5.  
  6. If Not IsDeclared('Turquoise') Then Dim $Turquoise = 0x40e0d0
  7. If Not IsDeclared('Crimson') Then Dim $Crimson = 0xDC143C
  8. If Not IsDeclared('White') Then Dim $White = 0xFFFFFF
  9.  
  10. Dim $hGUI, $treeview, $nItem1, $nItem2, $nItem3
  11. Dim $nSubItem1, $nSubItem2, $nSubItem3, $nSubItem4
  12. Dim $nButton, $Status, $nMsg
  13.  
  14. $hGUI = GUICreate("TreeView Item Get Tree", 392, 254)
  15.  
  16. $treeview = GUICtrlCreateTreeView(10, 10, 150, 150)
  17. $nItem2 = GUICtrlCreateTreeViewItem("Item2", $treeview)
  18. $nItem1 = GUICtrlCreateTreeViewItem("Item1", $treeview)
  19. $nSubItem2 = GUICtrlCreateTreeViewItem("SubItem2", $nItem1)
  20. $nSubItem1 = GUICtrlCreateTreeViewItem("SubItem1", $nItem1)
  21. $nSubItem4 = GUICtrlCreateTreeViewItem("SubItem4", $nSubItem1)
  22. $nSubItem3 = GUICtrlCreateTreeViewItem("SubItem3", $nSubItem1)
  23.  
  24. $nButton = GUICtrlCreateButton("Path?", 70, 170, 70, 20)
  25. $Status = GUICtrlCreateLabel("", 0, 234, 392, 20, BitOR($SS_SUNKEN, $SS_CENTER))
  26.  
  27. _GUICtrlTreeViewSetBkColor ($treeview, $Turquoise)
  28. _GUICtrlTreeViewSetTextColor ($treeview, $Crimson)
  29. _GUICtrlTreeViewSetLineColor ($treeview, $White)
  30. _GUICtrlTreeViewSetIndent ($treeview, 30)
  31.  
  32. GUISetState()
  33.  
  34. While 1
  35.     $nMsg = GUIGetMsg()
  36.     Select
  37.         Case $nMsg = $GUI_EVENT_CLOSE
  38.             ExitLoop
  39.         Case $nMsg = $nButton
  40.             GUICtrlSetData($Status, "Path: " & _GUICtrlTreeViewItemGetTree ($hGUI, $treeview, "\"))
  41.     EndSelect
  42. WEnd
  43.  
  44. Exit
  45.